CC= sw5cc -host
CC_SLAVE= sw5cc -slave
CFLAGS=-I${DAG_HOME}/dag_task_scheduler/include -L${DAG_HOME}/dag_task_scheduler/lib -O3
DAG_LIBFLAGS = -ldag_task_scheduler -lm -lstdc++ -lswperf
OBJS=bots_common.o bots_main.o sparselu.o sparselu_slave.o

EXTRA_FLAGS = -DBOTS_APP_DEF_ARG_SIZE=42 # Matrix Size
EXTRA_FLAGS += -DBOTS_APP_DEF_ARG_SIZE_1=30 # Submatrix Size  Maximum < 70
EXTRA_FLAGS += -DUSE_LDM
#EXTRA_FLAGS += -DUSE_LDM
EXTRA_FLAGS += -DATHREAD


bots_common.o:
	$(CC) -c $(CFLAGS) $(EXTRA_FLAGS) bots_common.c -o bots_common.o

bots_main.o:
	$(CC) -c $(CFLAGS) $(EXTRA_FLAGS) bots_main.c -o bots_main.o

sparselu.o:
	$(CC) -c $(CFLAGS) $(EXTRA_FLAGS) sparselu.c -o sparselu.o

sparselu_slave.o:
	$(CC_SLAVE) -c $(CFLAGS) $(EXTRA_FLAGS) sparselu_slave.c -o sparselu_slave.o

dag: bots_common.o bots_main.o sparselu.o sparselu_slave.o
	$(CC_SLAVE) -hybrid $(CFLAGS) $(EXTRA_FLAGS) $(OBJS) -o sparselu $(DAG_LIBFLAGS)

clean:
	rm -f *.o sparselu
